package com.wisely.highlight_spring4.ch3.conditional;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @ClassName WindowsCondition
 * @Package com.wisely.highlight_spring4.ch3.conditional
 * @Description TODO
 * @Author zjb
 * @Date 2018/7/23 11:35
 * @Version 1.0
 **/
public class WindowsCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        return  context.getEnvironment().getProperty("os.name").contains("Windows");
    }
}
